﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <script type="text/javascript" src="../Content/highlighter/scripts/shCore.js"></script>
    <script type="text/javascript" src="../Content/highlighter/scripts/shBrushCSharp.js"></script>
    <script type="text/javascript" src="../Content/highlighter/scripts/shBrushJScript.js"></script>
    <link type="text/css" rel="stylesheet" href="../Content/highlighter/styles/shCore.css" />
    <link type="text/css" rel="stylesheet" href="../Content/highlighter/styles/shCoreEclipse.css" />
    <script type="text/javascript">SyntaxHighlighter.all();</script>
</head>
<body>
    <h3>Json实体类生成</h3>
    新建以.nf.json结尾的json.nf.json文件
    内容如下
    <pre class="brush:javascript;">
        {
          "a": 1,
          "b": "string",
          "c": {
            "id": 1,
            "name": "Lucas"
          }
        }
    </pre>
    当保存该文件时，会自动生成json.cs实体类
    <pre class="brush:csharp;">
        // Generated by Lucas
        // http://chm.nfinal.com

        using System;
        using System.Collections.Generic;
        using NFinalServerSample.Code;

        namespace NFinalServerSample.Code
        {
            public class C
            {
                /// &lt;summary>
                /// Examples: 1
                /// &lt;/summary>
                public int id;
                /// &lt;summary>
                /// Examples: "Lucas"
                /// &lt;/summary>
                public string name;
            }
        }
        namespace NFinalServerSample.Code
        {
            public class json
            {
                /// &lt;summary>
                /// Examples: 1
                /// &lt;/summary>
                public int a;
                /// &lt;summary>
                /// Examples: "string"
                /// &lt;/summary>
                public string b;
                /// &lt;summary>
                /// Examples: {"id":1,"name":"Lucas"}
                /// &lt;/summary>
                public C c;
            }

        }
    </pre>
    <b>使用实体类解析Json字符串</b>
</body>
</html>